home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / cperf-21.lha / cperf-2.1 / tests / Makefile < prev    next >
Makefile  |  1989-11-01  |  3KB  |  66 lines

  1. # Copyright (C) 1989 Free Software Foundation, Inc.
  2. # written by Douglas C. Schmidt (schmidt@ics.uci.edu)
  3. # This file is part of GNU GPERF.
  4. # GNU GPERF is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 1, or (at your option)
  7. # any later version.
  8. # GNU GPERF is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with GNU GPERF; see the file COPYING.  If not, write to
  14. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  15.  
  16. GPERF = gperf
  17. CC = gcc
  18.  
  19. all: test
  20.  
  21. test:
  22.     @echo "performing some tests of the perfect hash generator"   
  23.     $(CC) -c -O test.c
  24.     $(GPERF) -p -c -l -S1 -C -o c.gperf > cinset.c
  25.     $(CC) -O -o cout cinset.c test.o
  26.     @echo "testing ANSI C reserved words, all items should be found in the set"
  27.     ./cout -v < c.gperf 
  28.     $(GPERF) -k1,4,'$$' ada.gperf > adainset.c
  29. # double '$$' is only there since make gets confused; program wants only 1 '$'
  30.     $(CC) -O -o aout adainset.c test.o
  31.     @echo "testing Ada reserved words,all items should be found in the set"
  32.     ./aout -v < ada.gperf 
  33.     $(GPERF) -p -D -S1 -k1,'$$' -s 2 -o adapredefined.gperf > preinset.c
  34.     $(CC) -O -o preout preinset.c test.o
  35.     @echo "testing Ada predefined words, all items should be found in the set"
  36.     ./preout -v < adapredefined.gperf 
  37.     $(GPERF) -k1,2,'$$' -o modula3.gperf > m3inset.c
  38.     $(CC) -O -o m3out m3inset.c test.o
  39.     @echo "testing Modula3 reserved words, all items should be found in the set"
  40.     ./m3out -v < modula3.gperf 
  41.     $(GPERF) -o -S1 -p < pascal.gperf > pinset.c
  42.     $(CC) -O -o pout pinset.c test.o
  43.     @echo "testing Pascal reserved words, all items should be found in the set"
  44.     ./pout -v < pascal.gperf     
  45.     $(GPERF) -o -S2 -j1 -D -p -t < c++.gperf > c++inset.c  
  46.     $(CC) -O -o c++out c++inset.c test.o
  47.     @echo "testing C++ reserved words, all items should be found in the set"
  48.     tail -47 c++.gperf | ./c++out -v     
  49. # these next 5 are demos that show off the generated code
  50.     $(GPERF) -p -j1 -g -o -t -N is_reserved_word -k1,3,'$$' c-parse.gperf
  51.     $(GPERF) -n -k1-8 -l modula2.gperf 
  52.     $(GPERF) -p -j 1 -o -a -g -t -k1,4,$$ gplus.gperf 
  53.     $(GPERF) -D -p -t < c-parse.gperf 
  54.     $(GPERF) -g -o -j1 -t -p -N is_reserved_word gpc.gperf
  55. # prints out the help message
  56.     -$(GPERF) -h 
  57.     @echo "only if, do, for, case, goto, else, while, and return should be found "
  58.     ./aout -v < c.gperf 
  59.  
  60. clean: 
  61.     -rm -f *.o core *~ *inset.c *out #*#
  62.